package com.njym.java.security.app.rest;

import com.njym.java.security.app.biz.CircleClassifyBiz;
import com.njym.java.security.app.entity.CircleClassify;
import com.njym.java.security.common.msg.TableResultResponse;
import com.njym.java.security.common.rest.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Controller
@RequestMapping("circleClassify")
public class CircleClassifyController extends BaseController<CircleClassifyBiz, CircleClassify> {

	@RequestMapping(value = "/list", method = RequestMethod.GET)
	@ResponseBody
	public TableResultResponse list() {
		Example example = new Example(CircleClassify.class);
		example.createCriteria().andEqualTo("deleted",0);
		example.orderBy("status");
		List list = baseBiz.selectByExample(example);
		return new TableResultResponse<>(list.size(),baseBiz.selectByExample(example));
	}

}